/* Copyright (c) 2025, Huawei Technologies.
 * All rights reserved.
 *
 * Licensed under the Apache License, Version 2.0  (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, softwares
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
import i18next from 'i18next';

i18next
    .init({
        fallbackLng: 'zh-CN',
        resources: {
            'en': {
                translation: {
                    fit: "Fit Screen",
                    settings: "Settings",
                    function: 'function',
                    show_debug_minimap: "show debug minimap",
                    show_bench_minimap: "show bench minimap",
                    shouldExpandNodesSync: "corresponding side node expanded synchronously", 
                    run: "Run",
                    tag: "Tag",
                    invalid_rank_id: "Tip: The target file does not exist",
                    data_side: "Data Side",
                    search_node: "Search Node",
                    node_list: "Node List",
                    debug: "Debug",
                    bench: "Bench",
                    accuracy_error: "Accuracy Error",
                    overflow: "Overflow",
                    match_accuracy_error: "Match Accuracy Error Node",
                    overflow_filter_node: "Overflow Filter Node",
                    no_matching_nodes: "No matching nodes",
                    precision_desc: {
                        summary: "The relative error between the statistical output of the debug side and the benchmark side of the node, the larger the value, the greater the precision gap, the darker the color mark, the relative error indicator (RelativeErr): | (debug value - benchmark value) / benchmark value |",
                        all: "The difference between the minimum double thousand indicator of all inputs and the minimum double thousandth indicator of all outputs of the node, reflecting the decline of the double thousand indicator, the larger the value, the greater the precision gap, the darker the color mark, the double thousandth precision indicator (One Thousandth Err Ratio): The relative error of each element in the tensor is compared with the corresponding benchmark data, the proportion of relative error less than one thousandth of the total number of elements, the closer the proportion is to 1, the better",
                        md5: "If the md5 value of any input or output of the node is different, it will be marked red"
                    },
                    node_match: "Node Match",
                    select_match_config_file: "Select Match Config File",
                    select_match_config_file_desc: "Select the corresponding configuration file, read the matching node information, and match the corresponding node.",
                    node_search: "Node Search",
                    screening_accuracy_error_metric: "Calculation Indicators for Screening Accuracy Error",
                    confirm: "Confirm",
                    cancel: "Cancel",
                    save: "Save",
                    color_setting: "Color Setting",
                    preset_configuration: "Default",
                    color_selection: "Color",
                    left_interval: "Left",
                    right_interval: "Right",
                    add_range: "Add",
                    unmatched_node: "Unmatched Node",
                    not_selected: "Not selected",
                    manage_nodes_and_subs: "Simultaneously operate on the selected node and its child nodes",
                    click_to_match: "Click to match",
                    cancel_matching: "Cancel Matching",
                    matched_nodes: "Matched Nodes",
                    matched: "matched",
                    unMatched: "unMatched",
                    debug_node: "Debug node",
                    bench_node: "Bench node",
                    comparison_details: "Comparison Details",
                    node_details: "Node Details",
                    node_information: "Node Information",
                    generate_matching_configuration_file: "Generate matching configuration files",
                    generate_matching_configuration_file_tooltip: "After completing manual matching, clicking Save Matching Node Information will save the matched node relationships to the configuration file without persisting the original file. If this is the first save, a new file will be created named: [Current File Name].vis.config",
                    save_tooltip: "Note: After completing the matching process, you must click the Save button to update the modified data to the file. Otherwise, the changes will not take effect.",
                    module_or_operators: "Module or Operators",
                    unexpanded_nodes: "Unexpanded Nodes",
                    api_list: "Api List",
                    multi_collection: "Multi Collection",
                    unexpanded_nodes_tooltip: "Unexpandable Node: It can be an Api, operator or module. It cannot be expanded because it has no subnodes",
                    api_list_tooltip: "Apis between modules",
                    multi_collection_tooltip: "Fusion node Collection",
                    no_iodata: "No IO data is currently available for this node.",
                    no_data: "No data is currently available for this node.",
                    copy: "copy",
                    copy_success: "Copy successful",
                    copy_fail: "Copy failed. Please try again.",
                    load_file_list_fail: "File list loading failed",
                    load_image_config_fail: "Image configuration loading failed",
                    load_graph_node_list_fail: "Failed to load graph node list",
                    upadte_map_data_fail: "Failed to update map data",
                    expand_fail: "Expand failed",
                    expand_fail_no_match_nodes: "Expansion failed: No matching nodes found for the current node or its parent node.",
                    retrieve_precision_menu_fail:  "Failed to retrieve precision menu. Please check the data in the toggleCheckbox and vis files.",
                    precision_error: "Error: Precision error calculation metric is empty. Please select a metric.",
                    percision_update_success: "Operation successful: Accuracy error value has been updated.",
                    caluculate_precision_error: "Calculation error in precision",
                    build_not_support_match: "Info: Build nodes do not support matching.",
                    unmatch_first: "Info: Please first select the node you wish to unmatch.",
                    cancel_match_success_part1: "Cancellation successful: ",
                    cancel_match_success_part2: " nodes canceled, corresponding node statuses updated.",
                    cancel_match_fail: "Failed to cancel matching",
                    match_success_part1: "Matching successful: Number of matched nodes:",
                    match_success_part2: ", The number of successful cases is: ",
                    match_success_part3: ", The number of failures is: ",
                    match_success_part4: ", The corresponding node status has been updated.",
                    match_fail: "Matching failed: ",
                    select_match_node: "Info: Please select the node to be matched.",
                    operation_fail: "Operation failed",
                    save_success: "Saved successfully: File has been modified.",
                    file_generate_success: "Operation successful: The file has been generated in the current directory with the filename ",
                    search_previous: "Search Previous",
                    search_next: "Search Next",
                    list_empty: "Info: The list is empty.",
                    bottom_of_list: "Info: You have reached the bottom of the list.",
                    top_of_list: "Info: You have reached the top of the list.",
                    retrieve_node_information_fail: "Failed to retrieve node information",
                    initializing_database: "Initializing database",
                    initializing_graph: "Initializing graph",
                    initialization_complete: "Initialization complete",
                    parsing_file: "Parsing file",
                    initializing_model: "Initializing the model. Please wait.",
                    please_wait: "Please wait",
                    graph_initialization_fail: "Graph initialization failed",
                    loadig_fail: "Loading failed",
                    file_format_wrong: "Please verify that the file format is correct.",
                    reading_file: "Reading file...",
                    configuration_items_missing: "Configuration failed. Please add configuration items.",
                    unconfigured_items_exist: "Configuration failed, unconfigured items exist.",
                    close: "close",
                    info: "Info"
                }
            },
            'zh-CN': {
                translation: {
                    fit: "自适应屏幕",
                    settings: "设置",
                    function: "功能",
                    show_debug_minimap: "调试侧缩略图",
                    show_bench_minimap: "标杆侧缩略图",
                    shouldExpandNodesSync: "是否同步展开对应侧节点",
                    run: "目录",
                    tag: "文件",
                    invalid_rank_id: "提示：目标文件不存在",
                    data_side: "数据侧",
                    search_node: "节点搜索",
                    node_list: "节点列表",
                    debug: "调试侧",
                    bench: "标杆侧",
                    accuracy_error: "精度误差",
                    overflow: "精度溢出",
                    match_accuracy_error: "符合精度误差节点",
                    overflow_filter_node: "符合溢出筛选节点",
                    no_matching_nodes: "无匹配节点",
                    precision_desc: {
                        "summary": "节点中调试侧和标杆侧输出的统计量相对误差，值越大精度差距越大，颜色标记越深,相对误差指标（RelativeErr）：| (调试值 - 标杆值) / 标杆值 |",
                        "all": "节点中所有输入的最小双千指标和所有输出的最小双千分之一指标的差值，反映了双千指标的下降情况，值越大精度差距越大，颜色标记越深，双千分之一精度指标（One Thousandth Err Ratio）：Tensor中的元素逐个与对应的标杆数据对比，相对误差小于千分之一的比例占总元素个数的比例，比例越接近1越好",
                        "md5": "节点中任意输入输出的md5值不同则标记为红色"
                    },
                    node_match: "节点匹配",
                    select_match_config_file: "选择匹配配置文件",
                    select_match_config_file_desc: "选择对应配置文件，会读取匹配节点信息，并将对应节点进行匹配。",
                    node_search: "节点搜索",
                    screening_accuracy_error_metric: "筛选精度误差计算指标",
                    confirm: "确认",
                    cancel: "取消",
                    save: "保存",
                    color_setting: "颜色设置",
                    preset_configuration: "预设配置",
                    color_selection: "颜色选择",
                    left_interval: "左区间",
                    right_interval: "右区间",
                    add_range: "添加区间",
                    unmatched_node: "未匹配节点",
                    not_selected: "未选择",
                    manage_nodes_and_subs: "操作选中节点及其子节点",
                    click_to_match: "点击匹配",
                    cancel_matching: "取消匹配",
                    matched_nodes: "已匹配节点",
                    matched: "已匹配",
                    unMatched: "未匹配",
                    debug_node: "标杆节点",
                    bench_node: "目标节点",
                    comparison_details: "比对详情",
                    node_details: "节点详情",
                    node_information: "节点信息",
                    generate_matching_configuration_file: "生成匹配配置文件",
                    generate_matching_configuration_file_tooltip: "手动匹配结束后，点击保存匹配节点信息，会将已匹配的节点对应关系保存到配置文件中，不会持久原始文件，如果是初次保存，会新建一个文件，文件名称为：[当前文件名].vis.config",
                    save_tooltip: "注意：匹配结束后需要点击保存按钮，将操作后数据更新到文件中，否则操作无效",
                    module_or_operators: "模块或算子",
                    unexpanded_nodes: "不可展开的节点",
                    api_list: "游离API集合",
                    multi_collection: "融合算子集合",
                    unexpanded_nodes_tooltip: "不可扩展节点：它可以是API、运算符或模块。由于其不包含子节点，因此无法展开",
                    api_list_tooltip: "模块之间游离API的集合",
                    multi_collection_tooltip: "融合算子集合",
                    no_iodata: "当前节点暂无IO数据",
                    no_data: "当前节点暂无数据",
                    copy: "复制",
                    copy_success: "复制成功",
                    copy_fail: "复制失败，请重试.",
                    load_file_list_fail: "文件列表加载失败",
                    load_image_config_fail: "图配置加载失败",
                    load_graph_node_list_fail: "图节点列表加载失败",
                    upadte_map_data_fail: "更新图数据失败",
                    expand_fail: "展开失败",
                    expand_fail_no_match_nodes: "展开失败：当前节点及其父节点无匹配节点",
                    retrieve_precision_menu_fail: "获取精度菜单失败，请检查 颜色配置项 和 vis 文件中的数据。",
                    precision_error: "错误: 精度误差计算指标为空，请选择指标",
                    percision_update_success: "操作成功：精度误差值已更新",
                    caluculate_precision_error: "精度误差计算错误",
                    build_not_support_match: '提示：单图节点不支持匹配',
                    unmatch_first: "提示：请先选择要取消匹配的节点",
                    cancel_match_success_part1: "取消成功：取消节点数",
                    cancel_match_success_part2: "个,对应节点状态已更新",
                    cancel_match_fail: "取消匹配失败",
                    match_success_part1: "匹配成功：匹配节点数量：",
                    match_success_part2: "，其中成功数量为：",
                    match_success_part3: "，其中失败数量为：",
                    match_success_part4: ", 对应节点状态已更新",
                    match_fail: "匹配失败： ",
                    select_match_node: "提示：请选择需要匹配的节点",
                    operation_fail: "操作失败",
                    save_success: "保存成功：文件已变更",
                    file_generate_success: "操作成功:文件已生成到当前目录下，文件名称为",
                    search_previous: "搜索上一项",
                    search_next: "搜索下一项",
                    list_empty: "提示：列表为空",
                    bottom_of_list: "提示：已到达列表底部",
                    top_of_list: "提示：已到达列表顶部",
                    retrieve_node_information_fail: "获取节点信息失败",
                    initializing_database: "正在初始化数据库",
                    initializing_graph: "正在初始化图",
                    initialization_complete: "初始化完成",
                    parsing_file: "正在解析文件",
                    initializing_model: "正在初始化模型，请稍后",
                    please_wait: "请稍后",
                    graph_initialization_fail: "初始化图失败",
                    loadig_fail: "加载失败",
                    file_format_wrong: "请检查文件格式是否正确",
                    reading_file: "正在读取文件",
                    configuration_items_missing: "配置失败，请添加配置项",
                    unconfigured_items_exist: "配置失败，存在未配置项",
                    close: "关闭",
                    info: "提示"
                }
            }
        },
        detection: {
            order: ['navigator'] // 只使用浏览器语言检测
        },
        debug: false,
        interpolation: {
            escapeValue: false
        }
    });

export default i18next;